% !TEX program = xelatex
%
% xelatex -shell-escape -shell-restricted
%
\XeTeXinputencoding   "UTF8"
\XeTeXdefaultencoding "UTF8"

% ------------------------------------------------
% 设置文档为UTF8编码的中文文档
%
% ------------------------------------------------
\documentclass[a4paper,UTF8,12pt]{ctexbook}
%\setCJKfamilyfont{song}{FandolSong-Regular.otf}
%\setCJKfamilyfont{hei}{FandolHei-Regular.otf}
%\setCJKfamilyfont{kai}{FandolKai-Regular.otf}
%\setCJKmainfont{宋体}%衬线字体 
%\setCJKmainfont{simsun}%衬线字体 
%\setCJKsansfont{黑体}%serif是有衬线字体sans serif无衬线字体。
%\setCJKmonofont{仿宋}%中文等宽字体
\usepackage{ctex,listings, hyperref, everypage}
\usepackage{transparent}
\usepackage{amsmath}
\usepackage[printwatermark]{xwatermark}
\hypersetup{
    pdftitle    = {标题},  % 标题
    pdfsubject  = {主题},  % 主题
    pdfauthor   = {作者},  % 作者
    pdfkeywords = {关键字}, % 关键字
    pdfcreator  = {创建者}, % 创建者
    pdfproducer = {制作者}, % 制作者
dvipdfm,                                          
pdfstartview=FitH,                                
bookmarks=true,
CJKbookmarks=true,                                
bookmarksnumbered=true,                           
bookmarksopen=true,                               
colorlinks=true,  %注释掉此项则交叉引用为彩色边框 
%(将colorlinks和pdfborder同时注释掉)
pdfborder=001,     %注释掉此项则交叉引用为彩色边框
citecolor=magenta, % magenta , cyan               
linkcolor=blue,
linktocpage,
nativepdf=true,
linktocpage=true,
}

\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{array}   
\graphicspath{ {figures/} }

%\newwatermark*[allpages,color=gray!100,angle=45,scale=2,xpos=0,ypos=0]{\transparent{0.2}{Released to Xiongmai Silicon under NDA}} %-- Add watermark

% ------------------------------------------------
% 设置页面尺寸
%
% showframe 可以作为调式选项加入到geometry中
% ------------------------------------------------
\usepackage{geometry}
%\geometry{}


% ------------------------------------------------
% 设置页面格式(包括页眉,页脚)
% ------------------------------------------------
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\cfoot{\thepage}

% ------------------------------------------------
% 
% ------------------------------------------------
\bibliographystyle{plain}
\title{\heiti 题目}
\author{\kaishu 作者}
\date{\today}  % 显示当天时间
%\ctexset{
%section={name={{\Huge\bf\S}},number={\normalsize{\arabic{section}}}},
%subsection={number=\arabic{section}.\arabic{subsection}},
%}

%\begin{titlepage}
%  \vspace*{\fill}
%  \begin{center}
%  \normalfont
%  {\Huge\bfseries aaaa}
%  \end{center}
%\end{titlepage}

%\includeonly{adc/doc/default,crc/doc/default,dma/doc/default}

\ifx\isBook\undefined
  \def\isBook{true}
  \def\SOC{demo}
  \def\TOP_DIR{.}
\fi

\begin{document}  % 文献所有内容都要在document里面
	%\maketitle     % 显示题目
	
    \begin{titlepage}
	
	    论文题名、作者姓名、日期等
	    pdflatex --enable-pipes --shell-escape mytexfile
	    \include{|"wc all.tex| tr -s ' ' | cut -d' ' -f 4"}
	
    \end{titlepage}
	
	\frontmatter
	\tableofcontents
	\thispagestyle{empty}
	\listoftables 
	\listoffigures

	\mainmatter
	aaa
	\input{../../../library/crc/doc/0000.chapter}
	%\include{adc/doc/default}
	%\include{dma/doc/default}

    \backmatter
    \chapter{修订历史}

\end{document}
